Enable Scroll To Text by default (#19634) Enables scroll to text by default for M81. Note we plan to launch via Finch for M80. Intent to ship with LGTMs: https://groups.google.com/a/chromium.org/d/msg/blink-dev/zlLSxQ9BA8Y/t-_3pAiSAwAJ This patch also updates web platform test expectations: - scroll-to-text-fragment.html now passes; it just needed an extra rAF for the fallback to element anchor behavior. - scroll-to-text-fragment-security.html has two expected failures, as they need to be updated to test cross-origin navigations. I'll make this change in a follow-up patch to close bug 1042311. Bug: 919204 Change-Id: Ic2d563934cd9406fb335904a94c390bba789e0b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1838701 Reviewed-by: Chris Harrelson <chrishtr@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Commit-Queue: Nick Burris <nburris@chromium.org> Cr-Commit-Position: refs/heads/master@{#732592} Co-authored-by: Nick Burris <nburris@chromium.org> diff --git a/scroll-to-text-fragment/scroll-to-text-fragment-target.html b/scroll-to-text-fragment/scroll-to-text-fragment-target.html index bc9ee9e..09d22ff 100644 --- a/scroll-to-text-fragment/scroll-to-text-fragment-target.html +++ b/scroll-to-text-fragment/scroll-to-text-fragment-target.html
@@ -48,6 +48,14 @@ let key = (new URL(document.location)).searchParams.get("key"); stashResults(key, results); } + +// Ensure two animation frames on load to test the fallback to element anchor, +// which gets queued for the next frame if the text fragment is not found. +window.onload = function() { + window.requestAnimationFrame(function() { + window.requestAnimationFrame(checkScroll); + }) +} </script> <style> .scroll-section { @@ -64,7 +72,7 @@ display: none; } </style> -<body onload="window.requestAnimationFrame(checkScroll)"> +<body> <div id="element" class="scroll-section">Element</div> <p id="text" class="scroll-section">This is a test page !$'()*+./:;=?@_~ &,- ネコ</p> <p id="more-text" class="scroll-section">More test page text</p>